﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KP_CommonLibrary.KP_CommonControls;
using KP_CommonLibrary;

namespace KEEPER_BRR_13dotNET.Presentation.List
{
    public partial class Frm_LyDoHoSoEdit : KP_CommonLibrary.KP_CoreUI.KP_EditListItem
    {
        public Frm_LyDoHoSoEdit()
        {
            InitializeComponent();
        }
        public override bool ValidateAll()
        {
            
            bool temp= base.ValidateAll();
            if (temp)
            {
                if (txtMaNhom.Text != "CL" && txtMaNhom.Text != "TD")
                {
                    KPMessageBox.Show("Mã nhóm lý do phải mang giá trị CL hoặc TD", KP_SYS_VARIABLE.M_KEEPER_VER, KPMessageBoxButton.OK, KPMessageBoxIcon.Warning);
                    return false;
                }
            }
            return temp;
                
        }
        private void txtMaNhom_TextChanged(object sender, EventArgs e)
        {
            if (txtMaNhom.Text == "TD")
                txtTenNhom.Text = "Thay đổi";
            else
                if (txtMaNhom.Text == "CL")
                    txtTenNhom.Text = "Thay đổi";
                else
                    txtTenNhom.Text = "Mã nhóm không đúng";

        }
    }
}
